<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of errorController
 *
 * @author QuangKhoi
 */
class ErrorController {
    private $model;
    private $view;
    
    private $errorCode;
    private $errorMessage;
    
    public function __construct($model, $view, $errorCode, $errorMessage) {
        $this->model = $model;
        $this->view = $view;
        $this->errorCode = $errorCode;
        $this->errorMessage = $errorMessage;
    }
    
    public function returnError() {
        $this->view->status = Status::withCode($this->errorCode, $this->errorMessage);
        $this->view->result = null;
        $this->view->display("Master/jsonView.php");
        die();
    }
}

?>
